package main

import (
	"github.com/astaxie/beego"
)
type TestController struct {
	beego.Controller
}

func (this *TestController) Get() {
	mystruct := `{"page": 1, "fruits": ["apple", "peach"]}`
	this.Data["json"] = &mystruct
	this.ServeJSON()
}

type MainController struct {
	beego.Controller
}

func (this *MainController) Get() {
	this.Ctx.WriteString("hello world")
}

func main() {
	beego.Router("/", &MainController{})
	beego.Router("/test", &TestController{})
	beego.Run()
}
